//
// CParticleSystemShape.java
// Copyright (C) 2010  "Naush" <naush _ hotmail _ fr>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>./* ----------------------------------------------------------------------------







package org.ryzom.nel.threed;

import org.ryzom.nel.misc.IStream;

public class CParticleSystemShape {
  private long swigCPtr;
  protected boolean swigCMemOwn;

  public CParticleSystemShape(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  public static long getCPtr(CParticleSystemShape obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        nel3dJNI.delete_CParticleSystemShape(swigCPtr);
      }
      swigCPtr = 0;
    }
  }

  public CParticleSystemShape() {
    this(nel3dJNI.new_CParticleSystemShape(), true);
  }

  public static void releaseInstance() {
    nel3dJNI.CParticleSystemShape_releaseInstance();
  }

  public void buildFromPS(CParticleSystem ps) {
    nel3dJNI.CParticleSystemShape_buildFromPS(swigCPtr, this, CParticleSystem.getCPtr(ps), ps);
  }

  public CTransformShape createInstance(CScene scene) {
    long cPtr = nel3dJNI.CParticleSystemShape_createInstance(swigCPtr, this, CScene.getCPtr(scene), scene);
    return (cPtr == 0) ? null : new CTransformShape(cPtr, false);
  }

  public void render(IDriver drv, CTransformShape trans, boolean passOpaque) {
    nel3dJNI.CParticleSystemShape_render(swigCPtr, this, IDriver.getCPtr(drv), drv, CTransformShape.getCPtr(trans), trans, passOpaque);
  }

  public void serial(IStream f) {
    nel3dJNI.CParticleSystemShape_serial(swigCPtr, this, IStream.getCPtr(f), f);
  }

  public CTrackDefaultFloat getUserParamDefaultTrack(long numTrack) {
    long cPtr = nel3dJNI.CParticleSystemShape_getUserParamDefaultTrack(swigCPtr, this, numTrack);
    return (cPtr == 0) ? null : new CTrackDefaultFloat(cPtr, false);
  }

  public CTrackDefaultBool getDefaultTriggerTrack() {
    long cPtr = nel3dJNI.CParticleSystemShape_getDefaultTriggerTrack(swigCPtr, this);
    return (cPtr == 0) ? null : new CTrackDefaultBool(cPtr, false);
  }

  public void getAABBox(SWIGTYPE_p_NLMISC__CAABBox bbox) {
    nel3dJNI.CParticleSystemShape_getAABBox(swigCPtr, this, SWIGTYPE_p_NLMISC__CAABBox.getCPtr(bbox));
  }

  public float getNumTriangles(float arg0) {
    return nel3dJNI.CParticleSystemShape_getNumTriangles(swigCPtr, this, arg0);
  }

  public CTrackDefaultVector getDefaultPos() {
    long cPtr = nel3dJNI.CParticleSystemShape_getDefaultPos(swigCPtr, this);
    return (cPtr == 0) ? null : new CTrackDefaultVector(cPtr, false);
  }

  public CTrackDefaultVector getDefaultScale() {
    long cPtr = nel3dJNI.CParticleSystemShape_getDefaultScale(swigCPtr, this);
    return (cPtr == 0) ? null : new CTrackDefaultVector(cPtr, false);
  }

  public CTrackDefaultQuat getDefaultRotQuat() {
    long cPtr = nel3dJNI.CParticleSystemShape_getDefaultRotQuat(swigCPtr, this);
    return (cPtr == 0) ? null : new CTrackDefaultQuat(cPtr, false);
  }

  public boolean isShared() {
    return nel3dJNI.CParticleSystemShape_isShared(swigCPtr, this);
  }

  public long getNumCachedTextures() {
    return nel3dJNI.CParticleSystemShape_getNumCachedTextures(swigCPtr, this);
  }

  public ITexture getCachedTexture(long index) {
    long cPtr = nel3dJNI.CParticleSystemShape_getCachedTexture(swigCPtr, this, index);
    return (cPtr == 0) ? null : new ITexture(cPtr, false);
  }

  public CParticleSystem instanciatePS(CScene scene, SWIGTYPE_p_NLMISC__CContiguousBlockAllocator blockAllocator) {
    long cPtr = nel3dJNI.CParticleSystemShape_instanciatePS__SWIG_0(swigCPtr, this, CScene.getCPtr(scene), scene, SWIGTYPE_p_NLMISC__CContiguousBlockAllocator.getCPtr(blockAllocator));
    return (cPtr == 0) ? null : new CParticleSystem(cPtr, false);
  }

  public CParticleSystem instanciatePS(CScene scene) {
    long cPtr = nel3dJNI.CParticleSystemShape_instanciatePS__SWIG_1(swigCPtr, this, CScene.getCPtr(scene), scene);
    return (cPtr == 0) ? null : new CParticleSystem(cPtr, false);
  }

  public void flushTextures(IDriver driver, long selectedTexture) {
    nel3dJNI.CParticleSystemShape_flushTextures(swigCPtr, this, IDriver.getCPtr(driver), driver, selectedTexture);
  }

  public void set_ProcessOrder(Vector_uint16 value) {
    nel3dJNI.CParticleSystemShape__ProcessOrder_set(swigCPtr, this, Vector_uint16.getCPtr(value), value);
  }

  public Vector_uint16 get_ProcessOrder() {
    long cPtr = nel3dJNI.CParticleSystemShape__ProcessOrder_get(swigCPtr, this);
    return (cPtr == 0) ? null : new Vector_uint16(cPtr, false);
  }

}
